Skip to content

V2 sdk#2

Merged
WarTech9 merged 6 commits into
mainfrom
v2-sdk
Feb 26, 2026
Merged

V2 sdk#2
WarTech9 merged 6 commits into
mainfrom
v2-sdk

Conversation

@WarTech9

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a major v2 API migration for the ClawSwap SDK, introducing breaking changes to field names, response structures, and error handling patterns. The core SDK implementation (packages/sdk/src/) has been successfully updated to v2 with comprehensive test coverage. However, the browser example applications (examples/browser/ and examples/browser-wagmi/) have not been updated and still use v1 API field names, making them non-functional. A new browser-wagmi example was added to demonstrate integration with wagmi v2 and ConnectKit.

Changes:

  • Core SDK updated to v2 API with new field names (sourceChain/sourceToken vs sourceChainId/sourceTokenAddress, userWallet/recipient vs senderAddress/recipientAddress)
  • Response structures changed (estimatedOutput vs destinationAmount, requestId vs orderId, new fee structure)
  • Error handling updated with new error types and suggestion fields
  • New browser-wagmi example added demonstrating wagmi v2 integration
  • Test files updated and passing with v2 API

Reviewed changes

Copilot reviewed 43 out of 46 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
packages/sdk/src/types.ts Updated to v2 API types with renamed fields and new response structures
packages/sdk/src/schemas.ts Updated validation schemas for v2 field names
packages/sdk/src/errors.ts New error types and v2 error envelope structure
packages/sdk/src/client.ts Client methods updated for v2 API, improved token fetching optimization
packages/sdk/src/utils/polling.ts Updated terminal status check for v2 statuses
packages/sdk/src/utils/http.ts Updated error handling for v2 error envelope
packages/sdk/tests/*.test.ts Comprehensive test updates for v2 API
examples/node-cli/ Successfully updated to v2 API
examples/browser/ NOT updated - still uses v1 API (critical issue)
examples/browser-wagmi/ NOT updated - still uses v1 API (critical issue)
pnpm-workspace.yaml Added browser-wagmi example to workspace
README.md Updated documentation for v2 API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/browser/src/hooks/useWallet.ts
Comment thread examples/browser/src/components/SwapButton.tsx Outdated
Comment thread examples/browser/src/components/QuoteForm.tsx Outdated
Comment thread examples/browser/src/components/StatusPanel.tsx
Comment thread examples/browser-wagmi/src/components/SwapForm.tsx Outdated
Comment thread examples/browser/src/components/SwapButton.tsx Outdated
Comment thread examples/browser/src/components/SwapButton.tsx Outdated
Comment thread examples/browser/src/components/QuoteForm.tsx Outdated
Comment thread examples/browser/src/components/StatusPanel.tsx Outdated
Comment thread examples/browser-wagmi/src/components/SwapProgress.tsx Outdated
@WarTech9
WarTech9 merged commit 17f4f49 into main Feb 26, 2026
1 check passed
@WarTech9
WarTech9 deleted the v2-sdk branch February 26, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants